﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NObsidian.Containers;

namespace NObsidian.Managers
{
    public class CampaignManager : ManagerBase
    {
        public CampaignManager(ObsidianProxy proxy)
            : base(proxy)
        {
        }

        public Campaign GetCampaign(string id)
        {
            string campaign;
            string url;

            url = ComposeGetCampaignURL(id);
            campaign = _proxy.GetObsidianData(url);

            return _proxy.GetObjectFromJson<Campaign>(campaign);
        }

        private string ComposeGetCampaignURL(string id)
        {
            StringBuilder sb = new StringBuilder();

            return sb.Append(CAMPAIGNS_URL).Append(id).Append(".json").ToString();
        }

    }
}
